package com.codebo.homiematchbackend.model.enums;

public enum ChatTypeEnum
{
    PRIVATE_CHAT("私聊", 0),
    GROUP_CHAT("群聊", 1);
    private final String text;
    private final int value;

    ChatTypeEnum(String text, int value)
    {
        this.text = text;
        this.value = value;
    }

    public static ChatTypeEnum getEnumByValue(Integer value)
    {
        if (value == null)
        {
            return null;
        }
        for (ChatTypeEnum chatTypeEnum : ChatTypeEnum.values())
        {
            if (chatTypeEnum.value == value)
            {
                return chatTypeEnum;
            }
        }
        return null;
    }
}
